<?php
namespace app\controller;

use app\BaseController;
use \think\facade\Db;
use app\utils\Excel;

class Index extends BaseController
{
    /**
     * 学生Excel获取模板
     */
    public function getStudentExcelModel(){
        $header = ["A1" => "学号", "B1" => "姓名", "C1" => "性别(男/女)","D1"=>"密码不填(默认为学号)"];
        $data = [];
        
        $type= true;
        // 设置下载文件保存的名称
        $fileName = '学生信息导入模板'.time();
        // 调用方法导出excel
        Excel::export($header,$type,$data,$fileName);
    }

    /**
     * 课程学生Excel获取模板
     */
    public function getCourseExcelModal(){
        $header = ["A1" => "学号"];
        $data = [];
        
        $type= true;
        // 设置下载文件保存的名称
        $fileName = '课程学生信息导入模板'.time();
        // 调用方法导出excel
        Excel::export($header,$type,$data,$fileName);
    }

}
